<?php echo $html->css('articles.css') ?>
<div class="left">
    <h2 class="titles"><?php echo $question['Question']['title']; ?></h2>
    <div class="question">
        <div class="article">
            <div class="user-avatar">
                <?php echo $this->Avatar->userLink($question['User']); ?>
            </div>
            <div class="article-body">
                <div class="info">
                    <span class="user"> <?php echo $this->Linker->userLink($question['User']) ?></span>
                    <span class="time">
                        <?php echo $question['Question']['created']; ?>
                    </span>
                </div>
                <div class="content-body">
                    <?php echo $question['Question']['body']; ?>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="comment-list">
            <?php foreach ($Answers as $Answer): ?>
                            <div class="comment-entry">
                                <div class="user-avatar">
                    <?php echo $avatar->userLink($Answer['User']) ?>
                        </div>
                        <div class="comment-body">
                            <div class="info">
                                <span class="user"> <?php echo $linker->userLink($Answer['User']) ?></span>
                                <span class="time"> <?php echo $Answer['Answer']['created'] ?></span>
                            </div>
                            <div class="content">
	
                        <?php echo $formater->text($Answer['Answer']['body']) ?>

						<p> 
							<?php if ($Answer['Answer']['marked_as']==Answer::BEST): ?>
								最佳答案！
								<?php else: ?>
									
									<?php if ($cuid == $question['Question']['user_id'] and !$solved): ?>
										
								<?php echo $html->link('采纳为最佳答案',array('controller'=>'answers','action'=>'accept',$Answer['Answer']['id']),array('class'=>'btn')) ?>
									<?php endif ?>
							<?php endif ?>		</p>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
            <?php endforeach ?>
                            <div class="comment-form">
                <?php echo $this->Form->create('Answer', array('url' => '/Answers/add')); ?>
                            <div class="sub-titles"><?php __('我来回答：'); ?></div>
                <?php
                            echo $this->Form->textArea('body');
                            echo $this->Form->hidden('user_id', array('value' => $cuid));
                            echo $form->hidden('question_id', array('value' => $question['Question']['id']));
                ?>
                <?php echo $this->Form->end(__('添加', true)); ?>
                        </div>


                        <div class="comment-entry">
                            <p>
                    <?php
                            echo $this->Paginator->counter(array(
                                'format' => __('第 %page% 页，共 %pages% 页, 当前显示 %current% ／ %count% 项, 从 %start% 到 %end%', true)
                            ));
                    ?>	</p>
                <?php echo $this->Paginator->prev('<< ' . __('前页', true), array(), null, array('class' => 'disabled')); ?>
                    	 | 	<?php echo $this->Paginator->numbers(); ?>
                        |
                <?php echo $this->Paginator->next(__('后页', true) . ' >>', array(), null, array('class' => 'disabled')); ?>
                        </div>
                    </div>
                </div>

            </div>





            <div class="right">
                <h3><?php __('Actions'); ?></h3>
                <ul>
                    <li><?php echo $this->Html->link(__('Edit Question', true), array('action' => 'edit', $question['Question']['id'])); ?> </li>
                    <li><?php echo $this->Html->link(__('Delete Question', true), array('action' => 'delete', $question['Question']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $question['Question']['id'])); ?> </li>
                    <li><?php echo $this->Html->link(__('List Questions', true), array('action' => 'index')); ?> </li>
                    <li><?php echo $this->Html->link(__('New Question', true), array('action' => 'add')); ?> </li>
                    <li><?php echo $this->Html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
                    <li><?php echo $this->Html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
                    <li><?php echo $this->Html->link(__('List Answers', true), array('controller' => 'Answers', 'action' => 'index')); ?> </li>
                    <li><?php echo $this->Html->link(__('New Answer', true), array('controller' => 'Answers', 'action' => 'add')); ?> </li>
    </ul>
</div>
